<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<p id="p"></p>
<script>
	var pd = document.getElementById("p")
	pd.innerHTML="0"
	var n = 0,t=0
    window.onload = function(){
    	t = setInterval(function(){
    		n+=10
    		if(n > 100) {
	    		clearInterval(t)
	    		n = 0
	    		return
    		}else{
	    		pd.innerHTML=n
	    		console.log(n)
    		}
    		
    	},100)
    }
	
</script>
</body>
</html>